@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,100..1000&display=swap");

body {
  --c-glass: #bbbbbc;
  --c-light: #fff;
  --c-dark: #000;

  --c-content: #224;
  --c-action: #0052f5;

  --c-bg: #e8e8e9;

  --glass-reflex-dark: 1;
  --glass-reflex-light: 1;

  --saturation: 150%;

  font-size: 20px;
  font-family: "DM Sans", sans-serif;
  font-optical-sizing: auto;
  background: var(--c-bg);
  color: var(--c-content);

  transition: background 400ms cubic-bezier(1, 0, 0.4, 1),
    color 400ms cubic-bezier(1, 0, 0.4, 1);
}

body:has(input[value="dark"]:checked) {
  --c-glass: #bbbbbc;
  --c-light: #fff;
  --c-dark: #000;

  --c-content: #e1e1e1;
  --c-action: #03d5ff;

  --c-bg: #1b1b1d;

  --glass-reflex-dark: 2;
  --glass-reflex-light: 0.3;

  --saturation: 150%;
}

body:has(input[value="dim"]:checked) {
  --c-light: #99deff;
  --c-dark: #20001b;
  --c-glass: hsl(335 250% 74% / 1);

  --c-content: #d5dbe2;
  --c-action: #ff48a9;

  --c-bg: #152433;

  --glass-reflex-dark: 2;
  --glass-reflex-light: 0.7;

  --saturation: 200%;
}

.switcher {
  position: fixed;
  z-index: 1;
  top: 40px;
  left: 50%;
  translate: -50%;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 244px;
  max-width: 244px;
  height: 70px;
  box-sizing: border-box;
  padding: 8px 12px 10px;
  margin: 0 auto;
  border: none;
  border-radius: 99em;
  font-size: var(--fz);
  background-color: color-mix(in srgb, var(--c-glass) 12%, transparent);
  backdrop-filter: blur(8px) url(#switcher) saturate(var(--saturation));
  -webkit-backdrop-filter: blur(8px) saturate(var(--saturation));
  box-shadow: inset 0 0 0 1px
      color-mix(
        in srgb,
        var(--c-light) calc(var(--glass-reflex-light) * 10%),
        transparent
      ),
    inset 1.8px 3px 0px -2px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 90%), transparent),
    inset -2px -2px 0px -2px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 80%), transparent),
    inset -3px -8px 1px -6px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 60%), transparent),
    inset -0.3px -1px 4px 0px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 12%),
        transparent
      ),
    inset -1.5px 2.5px 0px -2px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 20%),
        transparent
      ),
    inset 0px 3px 4px -2px color-mix(in srgb, var(--c-dark)
          calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 2px -6.5px 1px -4px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 10%),
        transparent
      ),
    0px 1px 5px 0px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 10%),
        transparent
      ),
    0px 6px 16px 0px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 8%),
        transparent
      );
  transition: background-color 400ms cubic-bezier(1, 0, 0.4, 1),
    box-shadow 400ms cubic-bezier(1, 0, 0.4, 1);
}

.switcher__legend {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  -webkit-clip-path: inset(100%);
          clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.switcher__input {
  clip: rect(0 0 0 0);
  -webkit-clip-path: inset(100%);
          clip-path: inset(100%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

.switcher__icon {
  display: block;
  width: 100%;
  transition: scale 200ms cubic-bezier(0.5, 0, 0, 1);
}

.switcher__filter {
  position: absolute;
  width: 0;
  height: 0;
  z-index: -1;
}

.switcher__option {
  --c: var(--c-content);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  width: 68px;
  height: 100%;
  box-sizing: border-box;
  border-radius: 99em;
  opacity: 1;
  transition: all 160ms;
}

.switcher__option:hover {
  --c: var(--c-action);
  cursor: pointer;
}

.switcher__option:hover .switcher__icon {
  scale: 1.2;
}

.switcher__option:has(input:checked) {
  --c: var(--c-content);
  cursor: auto;
}

.switcher__option:has(input:checked) .switcher__icon {
  scale: 1;
}

.switcher::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  display: block;
  width: 84px;
  height: calc(100% - 10px);
  border-radius: 99em;
  background-color: color-mix(in srgb, var(--c-glass) 36%, transparent);
  z-index: -1;
  box-shadow: inset 0 0 0 1px
      color-mix(
        in srgb,
        var(--c-light) calc(var(--glass-reflex-light) * 10%),
        transparent
      ),
    inset 2px 1px 0px -1px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 90%), transparent),
    inset -1.5px -1px 0px -1px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 80%), transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 60%), transparent),
    inset -1px 2px 3px -1px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 20%),
        transparent
      ),
    inset 0px -4px 1px -2px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 10%),
        transparent
      ),
    0px 3px 6px 0px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 8%),
        transparent
      );
}

.switcher:has(input[c-option="1"]:checked)::after {
  translate: 0 0;
  transform-origin: right;
  transition: background-color 400ms cubic-bezier(1, 0, 0.4, 1),
    box-shadow 400ms cubic-bezier(1, 0, 0.4, 1),
    translate 400ms cubic-bezier(1, 0, 0.4, 1);
  -webkit-animation: scaleToggle 440ms ease;
          animation: scaleToggle 440ms ease;
}

.switcher:has(input[c-option="2"]:checked)::after {
  translate: 76px 0;
  transition: background-color 400ms cubic-bezier(1, 0, 0.4, 1),
    box-shadow 400ms cubic-bezier(1, 0, 0.4, 1),
    translate 400ms cubic-bezier(1, 0, 0.4, 1);
  -webkit-animation: scaleToggle2 440ms ease;
          animation: scaleToggle2 440ms ease;
}

.switcher[c-previous="1"]:has(input[c-option="2"]:checked)::after {
  transform-origin: left;
}

.switcher[c-previous="3"]:has(input[c-option="2"]:checked)::after {
  transform-origin: right;
}

.switcher:has(input[c-option="3"]:checked)::after {
  translate: 152px 0;
  transform-origin: left;
  transition: background-color 400ms cubic-bezier(1, 0, 0.4, 1),
    box-shadow 400ms cubic-bezier(1, 0, 0.4, 1),
    translate 400ms cubic-bezier(1, 0, 0.4, 1);
  -webkit-animation: scaleToggle3 440ms ease;
          animation: scaleToggle3 440ms ease;
}

@-webkit-keyframes scaleToggle {
  0% {
    scale: 1 1;
  }
  50% {
    scale: 1.1 1;
  }
  100% {
    scale: 1 1;
  }
}

@keyframes scaleToggle {
  0% {
    scale: 1 1;
  }
  50% {
    scale: 1.1 1;
  }
  100% {
    scale: 1 1;
  }
}

@-webkit-keyframes scaleToggle2 {
  0% {
    scale: 1 1;
  }
  50% {
    scale: 1.2 1;
  }
  100% {
    scale: 1 1;
  }
}

@keyframes scaleToggle2 {
  0% {
    scale: 1 1;
  }
  50% {
    scale: 1.2 1;
  }
  100% {
    scale: 1 1;
  }
}

@-webkit-keyframes scaleToggle3 {
  0% {
    scale: 1 1;
  }
  50% {
    scale: 1.1 1;
  }
  100% {
    scale: 1 1;
  }
}

@keyframes scaleToggle3 {
  0% {
    scale: 1 1;
  }
  50% {
    scale: 1.1 1;
  }
  100% {
    scale: 1 1;
  }
}

/* //////////////////////////////////////////
/  Article Styles //////////////////////// */

.article {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5em 2em;
}

h1,
h2,
p,
blockquote {
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

h1 {
  font-size: 3em;
  margin: 1.4em 0 0.6em;
}

h2 {
  font-size: 2em;
  margin: 1.4em 0 0.6em;
}

p {
  line-height: 160%;
  margin: 0 0 1em;
}

blockquote {
  margin-left: 0;
  margin-right: 0;
  font-size: 2em;
  padding-left: 1em;
  border-left: 0.1em solid currentColor;
}

figure {
  margin: 1em 0 2em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

figcaption {
  max-width: 600px;
  margin-top: 1em;
  font-size: 0.8em;
  color: color-mix(in srgb, var(--c-content) 60%, var(--c-bg));
}

a {
  color: var(--c-action);
  text-decoration-thickness: 0.05em;
  text-underline-position: under;
  -webkit-text-decoration-color: color-mix(in srgb, currentColor, transparent 70%);
          text-decoration-color: color-mix(in srgb, currentColor, transparent 70%);
  transition: color 160ms, -webkit-text-decoration-color 160ms;
  transition: color 160ms, text-decoration-color 160ms;
  transition: color 160ms, text-decoration-color 160ms, -webkit-text-decoration-color 160ms;
}

a:hover {
  color: color-mix(in srgb, var(--c-action), var(--c-content) 40%);
  -webkit-text-decoration-color: color-mix(in srgb, currentColor, transparent 30%);
          text-decoration-color: color-mix(in srgb, currentColor, transparent 30%);
}

img {
  display: block;
  border-radius: 0.8em;
  width: 100%;
  max-width: 700px;
  aspect-ratio: 5 / 3;
  -o-object-fit: cover;
     object-fit: cover;
}

.box {
  padding: 1em 1.4em;
  border-top: 4px solid color-mix(in srgb, var(--c-action) 50%, transparent);
  border-radius: 0.8em;
  background-color: color-mix(in srgb, var(--c-action) 8%, var(--c-bg));
  transition: background 400ms cubic-bezier(1, 0, 0.4, 1);
}